Option Strict Off
Option Explicit On
Friend Class frmDirectorySelect
	Inherits System.Windows.Forms.Form
	'This form allows the user to select a source directory from a drop down list.
	
	Private Sub frmDirectorySelect_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		Me.Left = VB6.TwipsToPixelsX((VB6.PixelsToTwipsX(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width) / 2) - (VB6.PixelsToTwipsX(Me.Width) / 2)) 'Set the window to be in the middle of the screen
		Me.Top = VB6.TwipsToPixelsY((VB6.PixelsToTwipsY(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height) / 2) - ((VB6.PixelsToTwipsX(Me.Width) / 2) + 420)) 'Set the window raised up slightly. So it is better positioned when running at 1024 x 768
	End Sub
	
	Private Sub cmdOk_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdOk.Click 'OK button has been clicked
		Me.Visible = False 'Hide the form
		frmUtilities2.txtSourceDirectory.Text = dirList.Path & "\" 'Set the text box on the utilities form to show the selected directory
		frmUtilities2.Refresh() 'Refresh the utilities form to show the updated text
	End Sub
	
	Private Sub drvList_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles drvList.SelectedIndexChanged 'The drive letter in the top window has changed
		dirList.Path = drvList.Drive 'Change the lower window to show the directories in that drive
	End Sub
End Class